//
//  HHPSecureManager.m
//  
//
//  Created by 韩红坡 on 2017/2/22.
//
//

#import "HHPSecureManager.h"

static HHPSecureManager *manager;

@interface HHPSecureManager ()

@property (nonatomic, strong, readwrite) dispatch_semaphore_t signalEncrypt;

@end

@implementation HHPSecureManager

+ (instancetype)shareManager
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[HHPSecureManager alloc] init];
        manager.secureEnable = YES;
        manager.secureLogEnable = YES;
        manager.signalEncrypt = dispatch_semaphore_create(1);
        manager.urlExemptionArray = [NSMutableArray array];
    });
    
    return manager;
}

- (BOOL)checkUrlExcemtionWithString:(NSString *)url
{
    for (NSString *str in self.urlExemptionArray) {
        if ([url containsString:str]) {
            return YES;
        }
    }
    
    return NO;
}

@end
